import jakarta.servlet.*;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;

import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "Nine", value = "/Nine")
public class Nine extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        response.setContentType("text/html");
        response.setContentType("application/msword");
        // must be the doc, if docx , the file can't open
        response.setHeader("Content-disposition", "attachment;filename=99.doc");
        PrintWriter out = response.getWriter();

        for(int i=1;i<10;i++){
            for(int j=1;j<=i;j++){
                out.print(j+"*"+i+"="+i*j+" ");
            }
            out.print("<br>");
        }
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
